﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Model.EntityModel;
using DataAccess;

namespace Project
{
    /// <summary>
    /// Interaction logic for PrintRequestingMedical.xaml
    /// </summary>
    public partial class PrintRequestingMedical : UserControl
    {
        Complaint c = new Complaint();
        Model.EntityModel.RequestingMedical r = new Model.EntityModel.RequestingMedical();
        Actor ActorVictim = new Actor();
        Person victim = new Person();

        public PrintRequestingMedical(long idComplaint)
        {
            InitializeComponent();
            try
            {
                c.Id = idComplaint;
                lblCaseNumber.Content = c.Id;
                r = RequestingMedicalDataAccess.GetRequestByIdComplaint(c.Id);
                ActorVictim = PersonAndActorDataAccess.GetActorByTypeAndComplaintId("Victima", c.Id);
                victim = PersonAndActorDataAccess.GetPersonById(ActorVictim.IdPerson);
                LblVictimName.Content = victim.Name + " " + victim.PaternalName + " " + victim.MaternalName;
                LblMedicalName.Content = r.MedicalName + " " + r.MedicalPaternalName + " " + r.MedicalMaternalName;
                LblMedicalCenter.Content = r.MedicalCenter;
                lblCaseDate.Content = r.RegistrationDate;
            }
            catch
            {
                Xceed.Wpf.Toolkit.MessageBox.Show("No hay una solicitud medica registrada para la denuncia", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
            }  
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {

        }
    }
}
